package com.juli.school.app.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.juli.school.service.bo.LotteryBo;
import com.juli.school.service.impl.LotteryService;
import com.juli.school.utils.core.model.CommonResp;
import com.juli.school.utils.core.model.PageResp;

/**
 * @Description: 抽奖奖品控制
 * @author: wjp
 * @date: 2018年3月25日上午10:59:53
 */
@Controller
@RequestMapping("lottery")
public class LotteryController {

	@Resource
	LotteryService lotteryService;

	/**
	 * @Description: 获取所有抽奖列表
	 * @author: wjp
	 * @date: 2018年3月31日下午5:12:04 
	 */
	@RequestMapping("listPage")
	@ResponseBody
	public CommonResp<PageResp<LotteryBo>> listPage(Integer pageNo, Integer pageSize) {
		return lotteryService.listPage(pageNo, pageSize);
	}

	/**
	 * @Description: 增加奖品
	 * @author: wjp
	 * @date: 2018年3月31日下午5:12:16 
	 */
	@RequestMapping("add")
	@ResponseBody
	public CommonResp<String> add(LotteryBo lotteryBo) {
		return lotteryService.add(lotteryBo);
	}

	/**
	 * @Description: 抽奖
	 * @author: wjp
	 * @date: 2018年3月24日下午1:50:18
	 */
	@RequestMapping("lotteryDraw")
	@ResponseBody
	public CommonResp<LotteryBo> lotteryDraw(String stuId, Integer pageNo, Integer pageSize,Integer integralNum) {
		return lotteryService.lotteryDraw(stuId, pageNo, pageSize,integralNum);
	}
}
